package com.surprise.db.repository;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import com.surprise.db.entity.Mall;

public class MallRepositoryImpl {
	  @PersistenceContext  
	    private EntityManager em;
	    public List<Mall>getByCondition(Mall u) {
	    	String hql = "select o.id,o.name from mall o where o.name like :name";
	    	TypedQuery<Mall> q = em.createQuery(hql,Mall.class);
	        q.setParameter("name", "%"+u.getName()+"%");     
	        q.setFirstResult(0);
	        q.setMaxResults(3);
	    	return null;
	}
}
